#include <stdio.h>
#include <stdlib.h>

struct stu
{
    int xh;
    char name[20];
    double score[4];
};
int main()
{
    int n;
    scanf("%d",&n);
    while(n--)
    {
        struct stu s;
        double t=0;
        scanf("%d %s",&s.xh,s.name);
        for(int i=0;i<4;i++)
        {
            scanf("%lf",&s.score[i]);
            t+=s.score[i];
        }
        printf("%d %s ",s.xh,s.name);
        printf("%.2lf %.2lf",t,t/4);
    }
    return 0;
}
